import request from './request'
import { useUserStore } from "../store/modules/user"
// 获取一级地址
export function getPrimaryAddress() {
    let token = {
        [useUserStore().row.tokenName]: useUserStore().token
    }
    return request({
        url: '/address/',
        method: 'get',
        headers: token
    })
}

// 获取子级地址
export function getSecondAddress(parentId) {
    let token = {
        [useUserStore().row.tokenName]: useUserStore().token
    }
    return request({
        url: '/address/' + parentId,
        method: 'get',
        headers: token
    })
}

// 获取系统全局设置的地址库级别
export function getAddressLevel() {
    let token = {
        [useUserStore().row.tokenName]: useUserStore().token
    }
    return request({
        url: '/set/getAddressLevel',
        method: 'get',
        headers: token
    })
}